package org.springblade.modules.repair.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import org.springblade.core.tool.node.INode;

import java.util.ArrayList;
import java.util.List;

/**
 * @Date 9:47 2022/8/29
 * @Description {
 *    通讯录
 * }
 * @Author lsay
 **/
@Data
public class DeptAddressListVO implements INode<DeptAddressListVO> {

	@JsonSerialize(using = ToStringSerializer.class)
	private Long id;

	@JsonSerialize(using = ToStringSerializer.class)
	private Long parentId;

	private String deptName;

	@JsonInclude(JsonInclude.Include.NON_EMPTY)
	private List<DeptAddressListVO> children;

	@JsonInclude(JsonInclude.Include.NON_EMPTY)
	private Boolean hasChildren;

	private Integer userSubscribe;
	private Integer user;

	private List<DeptAddressListUserVO> deptUserList;

	@Override
	public List<DeptAddressListVO> getChildren() {
		if (this.children == null) {
			this.children = new ArrayList<>();
		}
		return this.children;
	}
}
